package com.base.cn.platform.os.controller.mobile.subject;

import com.base.cn.platform.os.common.MobileBaseController;
import com.base.cn.platform.os.common.utils.result.ResultUtil;
import com.base.cn.platform.os.service.manage.subject.SubjectService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;
import java.util.Map;

/**
 * H5专业Controller
 *
 * @author s.li
 * @create 2018-05-24-15:26
 */
@Controller
@RequestMapping("/mobile/subject")
public class MobileSubjectController extends MobileBaseController {

    @Autowired
    private SubjectService subjectService;

    /**
     * 查询专业数据
     * @return Map<String,Object>
     */
    @RequestMapping("/ajax/findLayeredSubjectList")
    @ResponseBody
    public Map<String,Object> findLayeredSubjectList(@RequestBody Map<String, Object> params){
        params.put("status",1);//查询状态正常的
        Map<String,List<Map<String,Object>>> subjectMapList = subjectService.findSubjectListMap(params);
        return ResultUtil.SUCCESS("专业获取成功",subjectMapList);
    }
}
